<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>学法减分题库管理系统 - SPJX版本</title>
  <script>
    // 解决在子目录下的路径问题
    window.__SPJX_BASE_PATH__ = '/spjx/';
    
    // 确保存在哈希值
    if(!window.location.hash) window.location.hash = "#/";
    
    // 添加错误处理
    window.addEventListener('error', function(e) {
      if (e.target && (e.target.tagName === 'SCRIPT' || e.target.tagName === 'LINK')) {
        console.error('资源加载错误:', e.target.src || e.target.href);
      }
    }, true);
    
    // 全局错误处理
    window.onerror = function(message, source, lineno, colno, error) {
      console.error('全局错误:', message, source, lineno, colno);
      return false;
    };
    
    // 应用挂载检测
    window.addEventListener('DOMContentLoaded', function() {
      setTimeout(function() {
        var app = document.getElementById('app');
        if(!app || !app.hasChildNodes()) {
          console.warn('应用未能成功挂载，尝试重新加载...');
          window.location.reload();
        } else {
          console.log('应用成功挂载!');
        }
      }, 5000);
    });
  </script>
</head>
<body>
  <div id="app"></div>
  <!-- 应用将在这里挂载 -->
  
  <!-- 加载指示器，在应用加载时显示 -->
  <div id="loading" style="
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f5f7fa;
    z-index: 9999;
  ">
    <div style="text-align: center;">
      <div style="
        border: 5px solid #e6e6e6;
        border-radius: 50%;
        border-top: 5px solid #409EFF;
        width: 50px;
        height: 50px;
        margin: 0 auto 20px;
        animation: spin 1s linear infinite;
      "></div>
      <div>正在加载学法减分题库管理系统...</div>
    </div>
  </div>
  
  <style>
    @keyframes spin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }
    
    body {
      margin: 0;
      padding: 0;
      font-family: 'Microsoft YaHei', Arial, sans-serif;
    }
    
    #app:not(:empty) + #loading {
      display: none !important;
    }
  </style>
  
  <noscript>
    <strong>很抱歉，如果不启用JavaScript，学法减分题库系统将无法正常工作。请启用它继续。</strong>
  </noscript>
</body>
</html> 